﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Composite.Data;

namespace LCA.Data
{
    /// <summary>
    /// Summary description for Transportation
    /// </summary>
    public class TransportationDataProvider
    {
        private static Guid TransportationFCId = Guid.Parse("E88B3FD1-C671-4C8B-853D-1453968D744D");

        public static Dictionary<Guid, string> GetFlowForTransportationB()
        {
            Dictionary<Guid, string> results = new Dictionary<Guid, string>();
    
            using (DataConnection conn = new DataConnection())
            {
                var datas = from fc in conn.Get<LCA.Data.FlowCategoryFlow>()
                                                  join f in conn.Get<LCA.Data.Flow>() on fc.Flow equals f.Id
                                                  where fc.FlowCategory == TransportationFCId && f.IsDeleted == false
                                                  orderby fc.Ordinal
                                                  select f;


                foreach (dynamic data in datas)
                {
                    results.Add(data.Id, data.Name);
                }
            }

            return results;
        }
    }
}
